<?php


namespace api\models\queue;


use yii\base\BaseObject;
use yii\queue\JobInterface;
use yii\queue\Queue;

class Sms extends BaseObject implements JobInterface
{
    public $phone;
    public $message;


    /**
     * @param Queue $queue which pushed and is handling the job
     *
     * @return void|mixed result of the job execution
     */
    public function execute($queue)
    {
        /**@var \daixianceng\smser\YunpianSmser $sms */
        $sms = \Yii::$app->smser;
        $sms->send($this->phone, $this->message);
    }
}